package com.gouda.temporary.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.gouda.temporary.service.HongBaoCorpService;
import com.gouda.temporary.vo.HongBaoCorp;


@Controller
public class HongBaoCorpController {

	@Resource
	private HongBaoCorpService hongBaoCorpService;
	
	@RequestMapping(value = "/findAllHongBaoCorp.do")
	public ModelAndView findAllHongBaoCorp(String corp_id,Integer type){
		 Map<String, Object> map = new HashMap<String, Object>();
		 List<HongBaoCorp> hongbao = this.hongBaoCorpService.findAllHongBaoCorp(corp_id, type);
//		 System.out.println("hongbao:------------------"+hongbao.size());
		 String partid = null;
		 for(HongBaoCorp corp : hongbao){
//			 System.out.println(corp.getId());
//			 System.out.println(corp.getCorp_id());
//			 System.out.println(corp.getMch_id());
//			 System.out.println(corp.getWishing());
//			 System.out.println(corp.getClient_ip());
//			 System.out.println(corp.getAct_name());
			 partid = corp.getPartid();
		 }
		 
		 String str = "12,16,29,30,51";
		 String par = partid;
		 
		 for(int i=0;i<str.length();i++){
			 System.out.println("-------------------:"+i);
		 }
		 
		 
		 
		 map.put("hongbao", hongbao);
		 return new ModelAndView("hongbaoList", map);	 
	}
}
